package cn.edu.sdjzu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class HelloController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/hello")
    public String sayHello(){
        String url="http://Provider/hello";
        String result=restTemplate.getForObject(url,String.class);
        result=result+"It is from consumer application!";
        return result;
    }
}
